import urllib.request

def proxy_user():
    proxy_list = [
        {"http":"117.184.67.118:8060"},
        {"http":"163.204.247.245:9999"},
        {"http":"121.232.148.165:9000"},
        {"http":"118.122.114.236:9000"},
        {"http":"182.92.233.137:8118"}
    ]
    for proxy in proxy_list:
        print(proxy)
        # 利用遍历出来的ip创建对应的处理器
        proxy_handler = urllib.request.ProxyHandler(proxy)
        # 创建opener
        opener = urllib.request.build_opener(proxy_handler)
        try:
            opener.open("https://www.baidu.com", timeout=3)
            print("代理成功...")
        except Exception as e:
            print(e)

proxy_user()